<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/** 
<span class='line'>  2</span>  * 新しいADOのコマンドを作成する。&lt;br/>
<span class='line'>  3</span>    通常、AdoCommandを直接インスタンス化せず、AdoConnectionのサブクラスから、createCommandを呼びます。
<span class='line'>  4</span>  * @class ADOコマンドを表すクラス。クエリにパラメータが必要な場合は、このクラスを使います。
<span class='line'>  5</span> &lt;pre class = "code">
<span class='line'>  6</span> 使用例：
<span class='line'>  7</span> AdoAccessConnection.open("c:\\path\\to\\test.mdb", "", "", function(con) {
<span class='line'>  8</span>   var command = con.createCommand("UPDATE TEST SET COL2 = ? WHERE COL1 = ?");
<span class='line'>  9</span>   command.setStringParameter("COL2", "えええ");
<span class='line'> 10</span>   command.setStringParameter("COL1", "Z");
<span class='line'> 11</span>   command.executeUpdate();
<span class='line'> 12</span> });
<span class='line'> 13</span> 
<span class='line'> 14</span> AdoAccessConnection.open("c:\\path\\to\\test.mdb", "", "", function(con) {
<span class='line'> 15</span>   var command = con.createCommand("SELECT COL2 FROM TEST WHERE COL1 = ?");
<span class='line'> 16</span>   command.setStringParameter("COL1", "Z");
<span class='line'> 17</span>   var rs = command.executeQuery();
<span class='line'> 18</span> 
<span class='line'> 19</span>   print(rs[0]["COL2"]);
<span class='line'> 20</span> });
<span class='line'> 21</span> 
<span class='line'> 22</span> &lt;/pre>
<span class='line'> 23</span>  * @param {Object} con Adoコネクション
<span class='line'> 24</span>  */</span><span class="WHIT">
<span class='line'> 25</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">AdoCommand</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">con</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sql</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="WHIT">  </span><span class="NAME">this.con</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">con</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT">  </span><span class="NAME">this.sql</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">sql</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 28</span> </span><span class="WHIT">  </span><span class="NAME">this.params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 29</span> 
<span class='line'> 30</span> </span><span class="WHIT">  </span><span class="COMM">// コマンドの生成</span><span class="WHIT">
<span class='line'> 31</span> </span><span class="WHIT">  </span><span class="NAME">this.command</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">ActiveXObject</span><span class="PUNC">(</span><span class="STRN">"ADODB.Command"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 32</span> </span><span class="WHIT">  </span><span class="NAME">this.command.CommandText</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.sql</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="WHIT">  </span><span class="NAME">this.command.CommandType</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">AdoCommand.COMMAND_TYPE_CMD_TEXT</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="WHIT">  </span><span class="NAME">this.command.ActiveConnection</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.con.getRawConnection</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 36</span> 
<span class='line'> 37</span> </span><span class="COMM">/**
<span class='line'> 38</span>  * Command Typeの定数：テキスト(1)
<span class='line'> 39</span>  */</span><span class="WHIT">
<span class='line'> 40</span> </span><span class="NAME">AdoCommand.COMMAND_TYPE_CMD_TEXT</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// 通常</span><span class="WHIT">
<span class='line'> 41</span> 
<span class='line'> 42</span> </span><span class="COMM">/**
<span class='line'> 43</span>  * データ型の定数: Boolean(11)
<span class='line'> 44</span>  */</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="NAME">AdoCommand.DATA_TYPE_BOOLEAN</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">11</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 46</span> 
<span class='line'> 47</span> </span><span class="COMM">/**
<span class='line'> 48</span>  * データ型の定数: Char(129)
<span class='line'> 49</span>  */</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="NAME">AdoCommand.DATA_TYPE_CHAR</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">129</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 51</span> 
<span class='line'> 52</span> </span><span class="COMM">/**
<span class='line'> 53</span>  * データ型の定数: DBDate(133)
<span class='line'> 54</span>  */</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="NAME">AdoCommand.DATA_TYPE_DBDATE</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">133</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 56</span> 
<span class='line'> 57</span> </span><span class="COMM">/**
<span class='line'> 58</span>  * データ型の定数: DBTime(134)
<span class='line'> 59</span>  */</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="NAME">AdoCommand.DATA_TYPE_DBTIME</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">134</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 61</span> 
<span class='line'> 62</span> </span><span class="COMM">/**
<span class='line'> 63</span>  * データ型の定数: DBTimestamp(135)
<span class='line'> 64</span>  */</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="NAME">AdoCommand.DATA_TYPE_DBTIMESTAMP</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">135</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 66</span> 
<span class='line'> 67</span> </span><span class="COMM">/**
<span class='line'> 68</span>  * データ型の定数: Decimal(14)
<span class='line'> 69</span>  */</span><span class="WHIT">
<span class='line'> 70</span> </span><span class="NAME">AdoCommand.DATA_TYPE_DECIMAL</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">14</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 71</span> 
<span class='line'> 72</span> </span><span class="COMM">/**
<span class='line'> 73</span>  * データ型の定数: Double(5)
<span class='line'> 74</span>  */</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="NAME">AdoCommand.DATA_TYPE_DOUBLE</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">5</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 76</span> 
<span class='line'> 77</span> </span><span class="COMM">/**
<span class='line'> 78</span>  * データ型の定数: Integer(3)
<span class='line'> 79</span>  */</span><span class="WHIT">
<span class='line'> 80</span> </span><span class="NAME">AdoCommand.DATA_TYPE_INTEGER</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 81</span> 
<span class='line'> 82</span> </span><span class="COMM">/**
<span class='line'> 83</span>  * データ型の定数: Numeric(131)
<span class='line'> 84</span>  */</span><span class="WHIT">
<span class='line'> 85</span> </span><span class="NAME">AdoCommand.DATA_TYPE_NUMERIC</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">131</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 86</span> 
<span class='line'> 87</span> </span><span class="COMM">/**
<span class='line'> 88</span>  * データ型の定数: Single(4)
<span class='line'> 89</span>  */</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="NAME">AdoCommand.DATA_TYPE_SINGLE</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 91</span> 
<span class='line'> 92</span> </span><span class="COMM">/**
<span class='line'> 93</span>  * パラメータ方向の定数: Input(1)
<span class='line'> 94</span>  */</span><span class="WHIT">
<span class='line'> 95</span> </span><span class="NAME">AdoCommand.PARAMETER_DIRECTION_INPUT</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 96</span> 
<span class='line'> 97</span> </span><span class="COMM">// Prototypes of AdoCommand</span><span class="WHIT">
<span class='line'> 98</span> </span><span class="NAME">AdoCommand.prototype</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 99</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>100</span>    * 指定されたsqlを実行し、ハッシュ{fieldName: value}の配列として値を返す。
<span class='line'>101</span>    * @param {String} sql 実行するSQL
<span class='line'>102</span>    * @param {Array} params パラメータ
<span class='line'>103</span>    * @return {Array} ハッシュ{fieldName: value}の配列
<span class='line'>104</span>    */</span><span class="WHIT">
<span class='line'>105</span> </span><span class="WHIT">  </span><span class="NAME">executeQuery</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">sql</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>106</span> </span><span class="WHIT">    </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>107</span> </span><span class="WHIT">      </span><span class="COMM">// パラメータの追加</span><span class="WHIT">
<span class='line'>108</span> </span><span class="WHIT">      </span><span class="NAME">this.prepareParameter</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>109</span> 
<span class='line'>110</span> </span><span class="WHIT">      </span><span class="COMM">// SQLの実行</span><span class="WHIT">
<span class='line'>111</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.command.Execute</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>112</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.con.convertToArrayRs</span><span class="PUNC">(</span><span class="NAME">rs</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>113</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>114</span> </span><span class="WHIT">      </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="NAME">e</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>115</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">finally</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>116</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">rs</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>117</span> </span><span class="WHIT">        </span><span class="NAME">rs.Close</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>118</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>119</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>120</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>121</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>122</span>    * 指定されたsqlを実行する。
<span class='line'>123</span>    * @param {String} sql 実行するSQL
<span class='line'>124</span>    * @param {Array} params パラメータ
<span class='line'>125</span>    */</span><span class="WHIT">
<span class='line'>126</span> </span><span class="WHIT">  </span><span class="NAME">executeUpdate</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">sql</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>127</span> </span><span class="WHIT">    </span><span class="COMM">// パラメータの追加</span><span class="WHIT">
<span class='line'>128</span> </span><span class="WHIT">    </span><span class="NAME">this.prepareParameter</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>129</span> 
<span class='line'>130</span> </span><span class="WHIT">    </span><span class="COMM">// SQLの実行</span><span class="WHIT">
<span class='line'>131</span> </span><span class="WHIT">    </span><span class="NAME">this.command.Execute</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>132</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>133</span> </span><span class="WHIT">  </span><span class="COMM">// private</span><span class="WHIT">
<span class='line'>134</span> </span><span class="WHIT">  </span><span class="COMM">// パラメータの準備をする。</span><span class="WHIT">
<span class='line'>135</span> </span><span class="WHIT">  </span><span class="NAME">prepareParameter</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>136</span> </span><span class="WHIT">    </span><span class="COMM">// パラメータの追加</span><span class="WHIT">
<span class='line'>137</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">command</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.command</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>138</span> </span><span class="WHIT">    </span><span class="NAME">this.params.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">param</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>139</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">objParam</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">command.CreateParameter</span><span class="PUNC">(</span><span class="WHIT">
<span class='line'>140</span> </span><span class="WHIT">        </span><span class="NAME">param.Name</span><span class="WHIT">
<span class='line'>141</span> </span><span class="WHIT">        </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">param.Type</span><span class="WHIT">
<span class='line'>142</span> </span><span class="WHIT">        </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">param.Direction</span><span class="WHIT">
<span class='line'>143</span> </span><span class="WHIT">        </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">param.Size</span><span class="WHIT">
<span class='line'>144</span> </span><span class="WHIT">        </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">param.Value</span><span class="WHIT">
<span class='line'>145</span> </span><span class="WHIT">      </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>146</span> </span><span class="WHIT">      </span><span class="NAME">command.Parameters.Append</span><span class="PUNC">(</span><span class="NAME">objParam</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>147</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>148</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>149</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>150</span>    * 論理型のパラメータを作成する。
<span class='line'>151</span>    * @param {String} paramName パラメータ名
<span class='line'>152</span>    * @param {Boolean} paramValue パラメータ値
<span class='line'>153</span>    */</span><span class="WHIT">
<span class='line'>154</span> </span><span class="WHIT">  </span><span class="NAME">setBooleanParameter</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">paramName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">paramValue</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>155</span> </span><span class="WHIT">    </span><span class="NAME">this.params.push</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>156</span> </span><span class="WHIT">      </span><span class="STRN">"Name"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">paramName</span><span class="WHIT">
<span class='line'>157</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">AdoCommand.DATA_TYPE_BOOLEAN</span><span class="WHIT">
<span class='line'>158</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Direction"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">AdoCommand.PARAMETER_DIRECTION_INPUT</span><span class="WHIT">
<span class='line'>159</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Size"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="WHIT">
<span class='line'>160</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Value"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">paramValue</span><span class="WHIT">
<span class='line'>161</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>162</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>163</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>164</span>    * 文字列型のパラメータを作成する。
<span class='line'>165</span>    * @param {String} paramName パラメータ名
<span class='line'>166</span>    * @param {String} paramValue パラメータ値
<span class='line'>167</span>    */</span><span class="WHIT">
<span class='line'>168</span> </span><span class="WHIT">  </span><span class="NAME">setStringParameter</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">paramName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">paramValue</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>169</span> </span><span class="WHIT">    </span><span class="NAME">this.params.push</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>170</span> </span><span class="WHIT">      </span><span class="STRN">"Name"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">paramName</span><span class="WHIT">
<span class='line'>171</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">AdoCommand.DATA_TYPE_CHAR</span><span class="WHIT">
<span class='line'>172</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Direction"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">AdoCommand.PARAMETER_DIRECTION_INPUT</span><span class="WHIT">
<span class='line'>173</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Size"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="WHIT">
<span class='line'>174</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Value"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">paramValue</span><span class="WHIT">
<span class='line'>175</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>176</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>177</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>178</span>    * 日付型のパラメータを作成する。
<span class='line'>179</span>    * @param {String} paramName パラメータ名
<span class='line'>180</span>    * @param {Date} paramValue パラメータ値
<span class='line'>181</span>    */</span><span class="WHIT">
<span class='line'>182</span> </span><span class="WHIT">  </span><span class="NAME">setDateParameter</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">paramName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">paramValue</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>183</span> </span><span class="WHIT">    </span><span class="NAME">this.params.push</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>184</span> </span><span class="WHIT">      </span><span class="STRN">"Name"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">paramName</span><span class="WHIT">
<span class='line'>185</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">AdoCommand.DATA_TYPE_DBDATE</span><span class="WHIT">
<span class='line'>186</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Direction"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">AdoCommand.PARAMETER_DIRECTION_INPUT</span><span class="WHIT">
<span class='line'>187</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Size"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="WHIT">
<span class='line'>188</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Value"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">paramValue</span><span class="WHIT">
<span class='line'>189</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>190</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>191</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>192</span>    * 時刻型のパラメータを作成する。
<span class='line'>193</span>    * @param {String} paramName パラメータ名
<span class='line'>194</span>    * @param {Date} paramValue パラメータ値
<span class='line'>195</span>    */</span><span class="WHIT">
<span class='line'>196</span> </span><span class="WHIT">  </span><span class="NAME">setTimeParameter</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">paramName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">paramValue</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>197</span> </span><span class="WHIT">    </span><span class="NAME">this.params.push</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>198</span> </span><span class="WHIT">      </span><span class="STRN">"Name"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">paramName</span><span class="WHIT">
<span class='line'>199</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">AdoCommand.DATA_TYPE_DBTIME</span><span class="WHIT">
<span class='line'>200</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Direction"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">AdoCommand.PARAMETER_DIRECTION_INPUT</span><span class="WHIT">
<span class='line'>201</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Size"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="WHIT">
<span class='line'>202</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Value"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">paramValue</span><span class="WHIT">
<span class='line'>203</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>204</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>205</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>206</span>    * Timestamp型のパラメータを作成する。
<span class='line'>207</span>    * @param {String} paramName パラメータ名
<span class='line'>208</span>    * @param {Date} paramValue パラメータ値
<span class='line'>209</span>    */</span><span class="WHIT">
<span class='line'>210</span> </span><span class="WHIT">  </span><span class="NAME">setTimestampParameter</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">paramName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">paramValue</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>211</span> </span><span class="WHIT">    </span><span class="NAME">this.params.push</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>212</span> </span><span class="WHIT">      </span><span class="STRN">"Name"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">paramName</span><span class="WHIT">
<span class='line'>213</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">AdoCommand.DATA_TYPE_DBTIMESTAMP</span><span class="WHIT">
<span class='line'>214</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Direction"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">AdoCommand.PARAMETER_DIRECTION_INPUT</span><span class="WHIT">
<span class='line'>215</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Size"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="WHIT">
<span class='line'>216</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Value"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">paramValue</span><span class="WHIT">
<span class='line'>217</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>218</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>219</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>220</span>    * Deciaml型のパラメータを作成する。
<span class='line'>221</span>    * @param {String} paramName パラメータ名
<span class='line'>222</span>    * @param {Number} paramValue パラメータ値
<span class='line'>223</span>    */</span><span class="WHIT">
<span class='line'>224</span> </span><span class="WHIT">  </span><span class="NAME">setDecimalParameter</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">paramName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">paramValue</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>225</span> </span><span class="WHIT">    </span><span class="NAME">this.params.push</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>226</span> </span><span class="WHIT">      </span><span class="STRN">"Name"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">paramName</span><span class="WHIT">
<span class='line'>227</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">AdoCommand.DATA_TYPE_DECIMAL</span><span class="WHIT">
<span class='line'>228</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Direction"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">AdoCommand.PARAMETER_DIRECTION_INPUT</span><span class="WHIT">
<span class='line'>229</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Size"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="WHIT">
<span class='line'>230</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Value"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">paramValue</span><span class="WHIT">
<span class='line'>231</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>232</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>233</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>234</span>    * Double型のパラメータを作成する。
<span class='line'>235</span>    * @param {String} paramName パラメータ名
<span class='line'>236</span>    * @param {Date} paramValue パラメータ値
<span class='line'>237</span>    */</span><span class="WHIT">
<span class='line'>238</span> </span><span class="WHIT">  </span><span class="NAME">setDoubleParameter</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">paramName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">paramValue</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>239</span> </span><span class="WHIT">    </span><span class="NAME">this.params.push</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>240</span> </span><span class="WHIT">      </span><span class="STRN">"Name"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">paramName</span><span class="WHIT">
<span class='line'>241</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">AdoCommand.DATA_TYPE_DOUBLE</span><span class="WHIT">
<span class='line'>242</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Direction"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">AdoCommand.PARAMETER_DIRECTION_INPUT</span><span class="WHIT">
<span class='line'>243</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Size"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="WHIT">
<span class='line'>244</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Value"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">paramValue</span><span class="WHIT">
<span class='line'>245</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>246</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>247</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>248</span>    * Integer型のパラメータを作成する。
<span class='line'>249</span>    * @param {String} paramName パラメータ名
<span class='line'>250</span>    * @param {Date} paramValue パラメータ値
<span class='line'>251</span>    */</span><span class="WHIT">
<span class='line'>252</span> </span><span class="WHIT">  </span><span class="NAME">setIntegerParameter</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">paramName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">paramValue</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>253</span> </span><span class="WHIT">    </span><span class="NAME">this.params.push</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>254</span> </span><span class="WHIT">      </span><span class="STRN">"Name"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">paramName</span><span class="WHIT">
<span class='line'>255</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">AdoCommand.DATA_TYPE_INTEGER</span><span class="WHIT">
<span class='line'>256</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Direction"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">AdoCommand.PARAMETER_DIRECTION_INPUT</span><span class="WHIT">
<span class='line'>257</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Size"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="WHIT">
<span class='line'>258</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Value"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">paramValue</span><span class="WHIT">
<span class='line'>259</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>260</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>261</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>262</span>    * Numeric型のパラメータを作成する。
<span class='line'>263</span>    * @param {String} paramName パラメータ名
<span class='line'>264</span>    * @param {Date} paramValue パラメータ値
<span class='line'>265</span>    */</span><span class="WHIT">
<span class='line'>266</span> </span><span class="WHIT">  </span><span class="NAME">setNumericParameter</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">paramName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">paramValue</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>267</span> </span><span class="WHIT">    </span><span class="NAME">this.params.push</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>268</span> </span><span class="WHIT">      </span><span class="STRN">"Name"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">paramName</span><span class="WHIT">
<span class='line'>269</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">AdoCommand.DATA_TYPE_NUMERIC</span><span class="WHIT">
<span class='line'>270</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Direction"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">AdoCommand.PARAMETER_DIRECTION_INPUT</span><span class="WHIT">
<span class='line'>271</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Size"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="WHIT">
<span class='line'>272</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Value"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">paramValue</span><span class="WHIT">
<span class='line'>273</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>274</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>275</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>276</span>    * Single型のパラメータを作成する。
<span class='line'>277</span>    * @param {String} paramName パラメータ名
<span class='line'>278</span>    * @param {Date} paramValue パラメータ値
<span class='line'>279</span>    */</span><span class="WHIT">
<span class='line'>280</span> </span><span class="WHIT">  </span><span class="NAME">setSingleParameter</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">paramName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">paramValue</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>281</span> </span><span class="WHIT">    </span><span class="NAME">this.params.push</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>282</span> </span><span class="WHIT">      </span><span class="STRN">"Name"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">paramName</span><span class="WHIT">
<span class='line'>283</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">AdoCommand.DATA_TYPE_SINGLE</span><span class="WHIT">
<span class='line'>284</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Direction"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">AdoCommand.PARAMETER_DIRECTION_INPUT</span><span class="WHIT">
<span class='line'>285</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Size"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="WHIT">
<span class='line'>286</span> </span><span class="WHIT">      </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Value"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">paramValue</span><span class="WHIT">
<span class='line'>287</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>288</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>289</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>290</span> </span></pre></body></html>